package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsWarnConfig;
import com.econ.powercloud.ems.dal.mapper.EmsWarnConfigMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author : zjf
 * @Description : ems预警配置表
 * @Date : 2022/12/2 11:23
 * @Modified by : zjf
 */
@Repository
public class EmsWarnConfigDAO extends ServiceImpl<EmsWarnConfigMapper, EmsWarnConfig> {

    public List<EmsWarnConfig> selectListByDeviceCode(String deviceCode){
        LambdaQueryWrapper<EmsWarnConfig> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(StringUtils.isNotBlank(deviceCode),EmsWarnConfig::getDeviceCode,deviceCode);
        return this.baseMapper.selectList(wrapper);
    }

}
